/**
 * Description:
 * Class Name:FileWriterTest
 * Date:2022/5/1 17:26
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第15章_输入输出._15_3_字节流和字符流._15_3_2_OutputStream和Writer;

import java.io.FileWriter;
import java.io.IOException;

public class FileWriterTest {
    public static void main(String[] args) {
        try (var fw = new FileWriter("Chapter_15_poem.txt");){
            fw.write("锦瑟 - 李商隐\n");
            fw.write("锦瑟无端五十弦，一线一柱思华年。\n");
            fw.write("庄生晓梦迷蝴蝶，望帝春心托杜鹃。\n");
            fw.write("沧海月明珠有泪，蓝田玉暖日生烟。\n");
            fw.write("此情可待成追忆，只是当时已惘然。\n");
        }
        catch (IOException ioException){
            ioException.printStackTrace();
        }
    }
}
